
open Configfile

let defaults = [
  { sec_name = "DEFAULT"
  ; sec_opt_specs = [
    { opt_name = "test1"
    ; opt_default = ["1"; "2"; "3"]
    };
    { opt_name = "test2"
    ; opt_default = ["2"]
    };
    { opt_name = "xyz"
    ; opt_default = ["xyz"]
    }
  ]
  };
  { sec_name = "another_section"
  ; sec_opt_specs = [
    { opt_name = "test1"
    ; opt_default = ["1"]
    }
  ]
  }
]

let () =
  let file_in = Sys.argv.(1) and file_out = Sys.argv.(2) in
  Printf.printf "Reading %s and writing %s\n" file_in file_out;
  let t = Configfile.load (open_in file_in) file_in defaults in
  Configfile.save t (open_out file_out) true true




